﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Istace.Framework.Mapping.Core;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Istace.Framework.Mapping.UnitTest
{
    [TestClass]
    public class MappingAssertIsWorking
    {
        [TestMethod]
        public void CallToMapWithDestinationAndCorrectArgumentShouldReturnMappedObject()
        {
            Mapper.Initialize(this.GetType().Assembly, false, true);
            Assert.IsTrue(Mapper.Map<string>(10).Equals("10"));
        }

        [TestMethod]
        public void CallToMapListWithDestinationAndCorrectArgumentShouldReturnMappedObject()
        {
            Mapper.Initialize(this.GetType().Assembly, false, true);
            Assert.IsTrue(String.Join("",Mapper.MapList<string>(new List<int> { 10, 20 })).Equals("1020"));
        }

        [TestMethod]
        public void CallToMapWithDestinationAndSourceAndCorrectArgumentShouldReturnMappedObject()
        {
            Mapper.Initialize(this.GetType().Assembly, false, true);
            Assert.IsTrue(Mapper.Map<int, string>(50).Equals("50"));
        }

        [TestMethod]
        public void CallToMapListWithDestinationAndSourceCorrectArgumentShouldReturnMappedObject()
        {
            Mapper.Initialize(this.GetType().Assembly, false, true);
            Assert.IsTrue(String.Join("", Mapper.MapList<int, string>(new List<int> { 30, 40 })).Equals("3040"));
        }
    }
}
